package com.team.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 病人表
 * @TableName patient
 */
@TableName(value ="patient")
public class Patient implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 病人姓名
     */
    private String name;

    /**
     * 出生日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    /**
     * 性别 1-->女性，2-->男性
     */
    private Integer sex;

    /**
     * 家庭住址
     */
    private String address;

    /**
     * 联系方式
     */
    private String phone;

    /**
     * 身份证号
     */
    private String idCard;

    /**
     * 是否有医保卡 1-->没有，2-->有
     */
    private Integer isMedicare;

    /**
     * 医保卡号
     */
    private String idMedicare;

    /**
     * 创建时间
     */
    private Date createdTime;

    /**
     * 修改时间
     */
    private Date updatedTime;
    private Long sickRoom_id;
    private Integer isOut;

    public Integer getIsOut() {
        return isOut;
    }

    public void setIsOut(Integer isOut) {
        this.isOut = isOut;
    }

    public Long getSickRoom_id() {
        return sickRoom_id;
    }

    public void setSickRoom_id(Long sickRoom_id) {
        this.sickRoom_id = sickRoom_id;
    }

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public Long getId() {
        return id;
    }

    /**
     * 
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 病人姓名
     */
    public String getName() {
        return name;
    }

    /**
     * 病人姓名
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 出生日期
     */
    public Date getBirthday() {
        return birthday;
    }

    /**
     * 出生日期
     */
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    /**
     * 性别 1-->女性，2-->男性
     */
    public Integer getSex() {
        return sex;
    }

    /**
     * 性别 1-->女性，2-->男性
     */
    public void setSex(Integer sex) {
        this.sex = sex;
    }

    /**
     * 家庭住址
     */
    public String getAddress() {
        return address;
    }

    /**
     * 家庭住址
     */
    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * 联系方式
     */
    public String getPhone() {
        return phone;
    }

    /**
     * 联系方式
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * 身份证号
     */
    public String getIdCard() {
        return idCard;
    }

    /**
     * 身份证号
     */
    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    /**
     * 是否有医保卡 1-->没有，2-->有
     */
    public Integer getIsMedicare() {
        return isMedicare;
    }

    /**
     * 是否有医保卡 1-->没有，2-->有
     */
    public void setIsMedicare(Integer isMedicare) {
        this.isMedicare = isMedicare;
    }

    /**
     * 医保卡号
     */
    public String getIdMedicare() {
        return idMedicare;
    }

    /**
     * 医保卡号
     */
    public void setIdMedicare(String idMedicare) {
        this.idMedicare = idMedicare;
    }

    /**
     * 创建时间
     */
    public Date getCreatedTime() {
        return createdTime;
    }

    /**
     * 创建时间
     */
    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    /**
     * 修改时间
     */
    public Date getUpdatedTime() {
        return updatedTime;
    }

    /**
     * 修改时间
     */
    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Patient other = (Patient) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getBirthday() == null ? other.getBirthday() == null : this.getBirthday().equals(other.getBirthday()))
            && (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
            && (this.getIdCard() == null ? other.getIdCard() == null : this.getIdCard().equals(other.getIdCard()))
            && (this.getIsMedicare() == null ? other.getIsMedicare() == null : this.getIsMedicare().equals(other.getIsMedicare()))
            && (this.getIdMedicare() == null ? other.getIdMedicare() == null : this.getIdMedicare().equals(other.getIdMedicare()))
            && (this.getCreatedTime() == null ? other.getCreatedTime() == null : this.getCreatedTime().equals(other.getCreatedTime()))
            && (this.getUpdatedTime() == null ? other.getUpdatedTime() == null : this.getUpdatedTime().equals(other.getUpdatedTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getBirthday() == null) ? 0 : getBirthday().hashCode());
        result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getIdCard() == null) ? 0 : getIdCard().hashCode());
        result = prime * result + ((getIsMedicare() == null) ? 0 : getIsMedicare().hashCode());
        result = prime * result + ((getIdMedicare() == null) ? 0 : getIdMedicare().hashCode());
        result = prime * result + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
        result = prime * result + ((getUpdatedTime() == null) ? 0 : getUpdatedTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", birthday=").append(birthday);
        sb.append(", sex=").append(sex);
        sb.append(", address=").append(address);
        sb.append(", phone=").append(phone);
        sb.append(", idCard=").append(idCard);
        sb.append(", isMedicare=").append(isMedicare);
        sb.append(", idMedicare=").append(idMedicare);
        sb.append(", createdTime=").append(createdTime);
        sb.append(", updatedTime=").append(updatedTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}